Erik Kusch, PhD Student
Department of Biology
Section for Ecoinformatics & Biodiversity
Center for Biodiversity Dynamics in a Changing World (BIOCHANGE)
Aarhus University
16/04/2021
[Study Group] Bayesian Statistics with the Rethinking Material 1
16/04/2021
[Study Group] Bayesian Statistics with the Rethinking Material 2
Average slopes can be just as misleading as average
intercepts.
We want to apply pooling to estimates to varying slopes like
we did with varying intercepts.
16/04/2021
[Study Group] Bayesian Statistics with the Rethinking Material 3
They are related!
16/04/2021
[Study Group] Bayesian Statistics with the Rethinking Material 4
Varying intercepts
Varying slopes
Multivariate Prior
Average Intercepts
Covariance Matrix
Build Covariance Matrix
What’s a covariance matrix and
how do we get it?
16/04/2021
[Study Group] Bayesian Statistics with the Rethinking Material 5
“Inverse-Wishart is not a sensible distribution.”
“Decomposition is the way to go!”
16/04/2021
[Study Group] Bayesian Statistics with the Rethinking Material 6
It’s Matrix Algebra!
*
*
+
+
Diagonal of
Standard
Deviations
Correlation Matrix
This is just a demonstration to gain intuition!
16/04/2021
[Study Group] Bayesian Statistics with the Rethinking Material 7
Varying intercepts
Varying slopes
Multivariate Prior
Average Intercepts
Covariance Matrix
Fixed (non-adaptive) priors
Build Covariance Matrix
Correlation Matrix Prior
Values in correlation matrices
constrain each other.
So how do we set a prior for a
correlation matrix?
16/04/2021
[Study Group] Bayesian Statistics with the Rethinking Material 8
LKJ Correlation Prior!
Usually, we want to set a regularising prior here.
16/04/2021
[Study Group] Bayesian Statistics with the Rethinking Material 9
16/04/2021
[Study Group] Bayesian Statistics with the Rethinking Material 10
Shrinkage in
multiple
dimensions!
16/04/2021
[Study Group] Bayesian Statistics with the Rethinking Material 11
This is multi-
dimensional
shrinkage.
What’s special about
that?
16/04/2021
[Study Group] Bayesian Statistics with the Rethinking Material 12
This improves prediction accuracy just like before.
16/04/2021
[Study Group] Bayesian Statistics with the Rethinking Material 13
For more effective sampling.
So, what’s covariance good for?
16/04/2021
[Study Group] Bayesian Statistics with the Rethinking Material 14
What is it good for?!
Instrumental Variables.
Network Analyses.
Say it again y’all!
If used incorrectly, this
can induce bias
amplification!
[Study Group] Bayesian Statistics with the Rethinking Material
Unmeasured
Natural
Experiment /
Instrument /
Exposure
Q is a variable that satisfies these criteria:
1. Independent of U(Q U)
2. Not independent of E (Q ̸ E)
3. Q cannot influence W except through E
16/04/2021
15
16/04/2021
[Study Group] Bayesian Statistics with the Rethinking Material 16
Effect of the
confound
16/04/2021
[Study Group] Bayesian Statistics with the Rethinking Material 17
16/04/2021
[Study Group] Bayesian Statistics with the Rethinking Material 18
16/04/2021
[Study Group] Bayesian Statistics with the Rethinking Material 19
Dyadic effects A->B
and B-> A
Strong hypothesis
that they might be
correlated
Potentially
correlated
offsets of
receiving and
giving gifts
1
st
column
in gr matrix
(givers)
2
nd
column
in gr matrix
(receivers)
Same variance for both
household dyadic effects
Correlation matrix
16/04/2021
[Study Group] Bayesian Statistics with the Rethinking Material 20
The rich give more than the poor.
The more you receive the less you give?
16/04/2021
[Study Group] Bayesian Statistics with the Rethinking Material 21
Zero gifting between households is extremely reciprocal.
That’s a lot of reciprocity, right?
16/04/2021
[Study Group] Bayesian Statistics with the Rethinking Material 22
Gaussian process regression!
How can we use pooling for continuous predictors?
16/04/2021
[Study Group] Bayesian Statistics with the Rethinking Material 23
Add
Gaussian
Process
What
does k
mean?
What prior would we use here?
16/04/2021
[Study Group] Bayesian Statistics with the Rethinking Material 24
16/04/2021
[Study Group] Bayesian Statistics with the Rethinking Material 25
16/04/2021
[Study Group] Bayesian Statistics with the Rethinking Material 26
Poisson Model
Prior for k values
Lambda Model dependant on k
Covariance Matrix K
Prior for overall tools number
Prior for population size effect
Prior for maximum covariance (squared by
convention)
Prior for rate of decline (squared by
convention)
γ gets the Exponential(1) prior, too
16/04/2021
[Study Group] Bayesian Statistics with the Rethinking Material 27
Obtain correlation matrix by pushing betasq and rhosq through formula for K and making covariance into correlation.
16/04/2021
[Study Group] Bayesian Statistics with the Rethinking Material 28
16/04/2021
[Study Group] Bayesian Statistics with the Rethinking Material 29
All we need to do is add
information to S.
16/04/2021
[Study Group] Bayesian Statistics with the Rethinking Material 30
Surely, we can do better by accounting
for phylogenetic confounds.
16/04/2021
[Study Group] Bayesian Statistics with the Rethinking Material 31
16/04/2021
[Study Group] Bayesian Statistics with the Rethinking Material 32
Estimation of covariance decline function is
possible!
What if we want to account for non-linear
covariance functions?